"use strict";(()=>{var j=Object.defineProperty;var G=(e,t,r)=>t in e?j(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var C=(e,t,r)=>(G(e,typeof t!="symbol"?t+"":t,r),r);var l="fs-attributes";var B="cmsattribute";var v="cmscore";var m="cmsstatic";var R="support";var N=async(...e)=>{var r;let t=[];for(let n of e){let o=await((r=window.fsAttributes[n])==null?void 0:r.loading);t.push(o)}return t};var p=class{static activateAlerts(){this.alertsActivated=!0}static alert(t,r){if(this.alertsActivated&&window.alert(t),r==="error")throw new Error(t)}};C(p,"alertsActivated",!1);var _=()=>{};var f=e=>typeof e=="string";function h(e,t,r){var o;let n=window.fsAttributes[e];return n.destroy=r||_,(o=n.resolve)==null||o.call(n,t),t}var d=(e,t="1",r="iife")=>{let o=`${e}${r==="esm"?".esm":""}.js`;return`https://cdn.jsdelivr.net/npm/@finsweet/attributes-${e}@${t}/${o}`};var H=d(v,"1"),M=async()=>{let{fsAttributes:e}=window;e.cmscore||(e.cmscore={});let{cmscore:t}=e;if(t.import)return t.import;try{return t.import=import(H),t.import.then(r=>{r&&(t.version||(t.version=r.version))}),t.import}catch(r){p.alert(`${r}`,"error");return}};var q=`${l}-${R}`,O=async()=>{var o;let{fsAttributes:e,location:t}=window,{host:r,searchParams:n}=new URL(t.href);return!r.includes("webflow.io")||!n.has(q)?!1:(o=e.import)==null?void 0:o.call(e,R,"1")};var U=e=>t=>`${e}${t?`-${t}`:""}`,x=e=>{let t=(o,i,s)=>{let c=e[o],{key:a,values:T}=c,u;if(!i)return`[${a}]`;let A=T==null?void 0:T[i];f(A)?u=A:u=A(s&&"instanceIndex"in s?s.instanceIndex:void 0);let E=s&&"caseInsensitive"in s&&s.caseInsensitive?"i":"";if(!(s!=null&&s.operator))return`[${a}="${u}"${E}]`;switch(s.operator){case"prefixed":return`[${a}^="${u}"${E}]`;case"suffixed":return`[${a}$="${u}"${E}]`;case"contains":return`[${a}*="${u}"${E}]`}};function r(o,i){let s=t("element",o,i),c=(i==null?void 0:i.scope)||document;return i!=null&&i.all?[...c.querySelectorAll(s)]:c.querySelector(s)}return[t,r,(o,i)=>{let s=e[i];return s?o.getAttribute(s.key):null}]};var b={preventLoad:{key:`${l}-preventload`},debugMode:{key:`${l}-debug`},src:{key:"src",values:{finsweet:"@finsweet/attributes"}},dev:{key:`${l}-dev`}},[w,Ct]=x(b);var P=e=>{let{currentScript:t}=document,r={};if(!t)return{attributes:r,preventsLoad:!1};let o={preventsLoad:f(t.getAttribute(b.preventLoad.key)),attributes:r};for(let i in e){let s=t.getAttribute(e[i]);o.attributes[i]=s}return o};var L=({scriptAttributes:e,attributeKey:t,version:r,init:n})=>{var c;Y(),(c=window.fsAttributes)[t]||(c[t]={});let{preventsLoad:o,attributes:i}=P(e),s=window.fsAttributes[t];s.version=r,s.init=n,o||(window.Webflow||(window.Webflow=[]),window.Webflow.push(()=>n(i)))},Y=()=>{let e=z();if(window.fsAttributes&&!Array.isArray(window.fsAttributes)){g(window.fsAttributes,e);return}let t=X(e);g(t,e),W(t),window.fsAttributes=t,window.FsAttributes=window.fsAttributes,O()},X=e=>{let t={cms:{},push(...r){var n,o;for(let[i,s]of r)(o=(n=this[i])==null?void 0:n.loading)==null||o.then(s)},async import(r,n){let o=t[r];return o||new Promise(i=>{let s=document.createElement("script");s.src=d(r,n),s.async=!0,s.onload=()=>{let[c]=g(t,[r]);i(c)},document.head.append(s)})},destroy(){var r,n;for(let o of e)(n=(r=window.fsAttributes[o])==null?void 0:r.destroy)==null||n.call(r)}};return t},z=()=>{let e=w("src","finsweet",{operator:"contains"}),t=w("dev");return[...document.querySelectorAll(`script${e}, script${t}`)].reduce((o,i)=>{var c;let s=i.getAttribute(b.dev.key)||((c=i.src.match(/[\w-. ]+(?=(\.js)$)/))==null?void 0:c[0]);return s&&!o.includes(s)&&o.push(s),o},[])},g=(e,t)=>t.map(n=>{let o=e[n];return o||(e[n]={},o=e[n],o.loading=new Promise(i=>{o.resolve=s=>{i(s),delete o.resolve}}),o)}),W=e=>{let t=Array.isArray(window.fsAttributes)?window.fsAttributes:[];e.push(...t)};var $="1.3.0";function V(e,t){if(!e)return t!=null?t:null;let r=Number(e);return isNaN(r)?t||null:r}var I=`fs-${m}`,J="list",Z="static-item",tt="order",et="interactive",rt={true:"true"},ot="repeat",S={element:{key:`${I}-element`,values:{list:U(J),staticItem:U(Z)}},order:{key:`${I}-${tt}`},interactive:{key:`${I}-${et}`,values:rt},repeat:{key:`${I}-${ot}`}},[K,D,y]=x(S);async function k(e){let t=e.getInstanceIndex(S.element.key),n=D("staticItem",{all:!0,instanceIndex:t}).reduce((o,i)=>{let s=y(i,"order"),c=y(i,"interactive")===S.interactive.values.true,a=y(i,"repeat"),T=V(a),u=s===null?0:parseInt(s),A=isNaN(u)||u<=0?0:u-1;return o.push({itemElement:i,interactive:c,targetIndex:A,repeat:T}),o},[]);await e.addStaticItems(n)}var F=async()=>{let e=await M();if(!e)return[];await N(B);let t=e.createCMSListInstances([K("element","list",{operator:"prefixed"})]);return await Promise.all(t.map(k)),h(m,t,()=>{var r;for(let n of t)(r=n.destroy)==null||r.call(n)})};L({init:F,version:$,attributeKey:m});})();